#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

LL gcd(LL a,LL b)
{
	if(!b) return a;
	return gcd(b,a%b);
}

int main()
{
	LL x,y,z;cin>>x>>y>>z;
	
	cout<<gcd(gcd(x,y),z)<<endl;
	
	return 0;
}
